﻿Public Class empleado
    Private rut_ As String
    Private nombre_ As String
    Private comuna_ As Integer
    Private direccion_ As String
    Private telefono_ As Integer
    Private celular_ As Integer
    Private correo_ As String
    Private tipo_empleado_ As String

    Sub New()
        rut_ = "sin rut"
        nombre_ = "sin nombre"
        comuna_ = "sin comuna"
        direccion_ = "sin direccion"
        telefono_ = "sin telefono"
        celular_ = "sin celular"
        correo_ = "sin correo"
        tipo_empleado_ = "sin tipo de empleado"
    End Sub

    Property Rut() As String
        Get
            Return rut_
        End Get
        Set(ByVal value As String)
            If value.Trim().Length >= 1 Then
                rut_ = value
            Else
                Throw New Exception("Debe ingresar Rut")
            End If
        End Set
    End Property

    Property Nombre() As String
        Get
            Return nombre_
        End Get
        Set(ByVal value As String)
            If value.Trim().Length >= 1 Then
                nombre_ = value
            Else
                Throw New Exception("Debe ingresar Nombre")
            End If
        End Set
    End Property

    Property Comuna() As String
        Get
            Return comuna_
        End Get
        Set(ByVal value As String)
            If value.Trim().Length >= 1 Then
                comuna_ = value
            Else
                Throw New Exception("Debe ingresar Comuna")
            End If
        End Set
    End Property

    Property Direccion() As String
        Get
            Return direccion_
        End Get
        Set(ByVal value As String)
            If value.Trim().Length >= 1 Then
                direccion_ = value
            Else
                Throw New Exception("Debe ingresar Direccion")
            End If
        End Set
    End Property

    Property Telefono() As Integer
        Get
            Return telefono_
        End Get
        Set(ByVal value As Integer)
            If value >= 0 And value <= 20 Then
                telefono_ = value
            Else
                Throw New Exception("Debe ingresar Telefono")
            End If
        End Set
    End Property

    Property Celular() As Integer
        Get
            Return celular_
        End Get
        Set(ByVal value As Integer)
            If value >= 0 And value <= 20 Then
                celular_ = value
            Else
                Throw New Exception("Debe ingresar Celular")
            End If
        End Set
    End Property

    Property Correo() As String
        Get
            Return correo_
        End Get
        Set(ByVal value As String)
            If value.Trim().Length >= 1 Then
                correo_ = value
            Else
                Throw New Exception("Debe ingresar Correo")
            End If
        End Set
    End Property

    Property Tipo_Empleado() As String
        Get
            Return tipo_empleado_
        End Get
        Set(ByVal value As String)
            If value.Trim().Length >= 1 Then
                tipo_empleado_ = value
            Else
                Throw New Exception("Debe ingresar Tipo de trabajador")
            End If
        End Set
    End Property

End Class
